<template>
  <Designer ref="Designer"></Designer>
</template>

<script>
import Designer from '@/components/Designer.vue';

export default {
  name: 'FormDesign',
  components: {
    Designer
  },
  methods: {
    resolveFormId() {
      this.$nextTick(() => {
        let formId = this.$route.query.formId;
        this.$refs.Designer.setData({formId});
      });
    }
  },
  watch: {
    '$route.path': {
      handler(toPath, fromPath) {
        this.resolveFormId();
      },
      deep: true, // 深度监听
      immediate: true, // 第一次初始化渲染就可以监听到
    }
  }

};
</script>